#include "../include/head.h"

int epollAddNewFd(int epfd, int newFd)
{
    //将newFd加入epfd中
    struct epoll_event event;
    memset(&event, 0, sizeof(event));

    event.events = EPOLLIN;
    event.data.fd = newFd;

    int ret = epoll_ctl(epfd, EPOLL_CTL_ADD, newFd, &event);
    ERROR_CHECK(ret, -1, "epoll_ctl");
    return 0;
}

